package com.uobgroup.ews.uam.core.dao;

import java.util.List;

import com.uobgroup.ews.uam.core.domain.AccessControl;
import com.uobgroup.ews.uam.core.domain.CombinationACL;
import com.uobgroup.ews.uam.core.domain.CombinationMatrix;
import com.uobgroup.ews.uam.core.domain.CombinationType;
import com.uobgroup.ews.uam.core.domain.Reference;

public interface CombinationMatrixDao extends GenericDao<CombinationMatrix> {

   public long count();

   public List<CombinationMatrix> findAll(int firstResult, int maxResults);

   public long countCombinationMatrix(AccessControl accessControl);

   public CombinationMatrix update(CombinationMatrix combinationMatrix);

   public void deleteById(Long id);

   public boolean checkTheAssociationWithProfile(Long Id);

   public void removeCombinationACLs(List<CombinationACL> combinationACLs);

   public List<CombinationMatrix> findCombinationsByType(int type);

   /**
    * Get the list of combination matrices by type and description
    * 
    * @author ndduy
    * @param type
    *           {@link CombinationType}
    * @param description
    *           {@link String}
    * @return {@link List}
    */
   public List<CombinationMatrix> findByTypeAndDescription(CombinationType type, String description);

   public boolean isPropertiesExisted(CombinationMatrix combinationMatrix);

   public List<CombinationMatrix> searchMadatoryDocProperties(String doctype, String country);
   
   public List<CombinationMatrix> searchMadatoryCaseProperties(String processingType, String transType, String country);
   
   
   /**
    * @author dongn
    */
   public long countCombinationMatrixsThatHasCountryReference(Reference country);
   
   public long countCombinationMatrixsThatHasDocumentTypeReference(Reference documentType);
   
   public long countCombinationMatrixsThatHasProductTypeReference(Reference productType);
   
   public long countCombinationMatrixsThatHasTransactionTypeReference(Reference transactionType);
   
   public long countCombinationMatrixsThatHasProcessingCenterReference(Reference processingCentre);
   
   public long countCombinationMatrixsThatHasUserLocationReference(Reference userLocation);
   
}
